<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="UsersListPage.aspx.cs" Inherits="UsersListPage" title="Project Monitoring System" culture="Auto:en-US" uiculture="auto" meta:resourcekey="PageResource1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"
    Visible="false">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<div style="margin-left:10px;margin-right:10px;">
	<fieldset>
		<legend><asp:Label ID="lblRole" runat="server" Text="Change Role" meta:resourcekey="lblRoleResource1"></asp:Label></legend>
		<table>
			<tr>
				<td>
					<asp:Label ID="lblUserName" runat="server" Text="User Name" meta:resourcekey="lblUserNameResource1"></asp:Label>
				</td>
				<td>
					<asp:TextBox ID="txtUserName" runat="server" CssClass="lookup" Width="199px" Enabled="False" meta:resourcekey="txtUserNameResource1"></asp:TextBox>
				</td>
				<td width="10"></td>
				<td>
					<asp:Label ID="lblRoleStatic" runat="server" Text="Role" meta:resourcekey="lblRoleStaticResource1"></asp:Label>
				</td>
				<td>
					<asp:ObjectDataSource ID="ODSRoles" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllRoles" TypeName="System.Web.Security.Roles"></asp:ObjectDataSource>
					<asp:DropDownList ID="ddlRole" runat="server" DataSourceID="ODSRoles" Width="203px" OnPreRender="ddlRole_PreRender" meta:resourcekey="ddlRoleResource1"/>
				</td>
				<td width="10"></td>
				<td>
					<asp:Label ID="lblAdvAlertDay" runat="server" Text="Advance Alert Day" meta:resourcekey="lblAdvAlertDayResource1"></asp:Label>
				</td>
				<td>
					<asp:TextBox ID="txtAdvAlertDay" runat="server" CssClass="required" MaxLength="3" Width="35px" meta:resourcekey="txtAdvAlertDayResource1"></asp:TextBox>
					<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtAdvAlertDay" Display="Dynamic" ErrorMessage="Advance Alert Day is a required field." meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator>
				</td>
				<td width="10"></td>
				<td>
					<asp:Label ID="lblSuperUser" runat="server" Text="Super User" meta:resourcekey="lblSuperUserResource1"></asp:Label>
				</td>
				<td>
					<asp:CheckBox ID="cbSuperUser" runat="server" meta:resourcekey="cbSuperUserResource1" />
				</td>
			</tr>
			<tr>	
				<td colspan="11" align="center">
					<asp:Button ID="btnSave" runat="server" CssClass="submit" Text="Save" OnClick="btnSave_Click" meta:resourcekey="btnSaveResource1" />
		            <asp:ObjectDataSource ID="ODSCurrentRole" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetRolesForUser" TypeName="System.Web.Security.Roles">
			            <SelectParameters>
				            <asp:ControlParameter ControlID="txtUserName" DefaultValue="x" Name="username" PropertyName="Text" />
			            </SelectParameters>
		            </asp:ObjectDataSource>
		            <asp:DropDownList ID="ddlCurrentRole" runat="server" AutoPostBack="True" DataSourceID="ODSCurrentRole" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" CssClass="hidden" meta:resourcekey="ddlCurrentRoleResource1"></asp:DropDownList>
				</td>
			</tr>
		</table>
	</fieldset>
	<asp:Panel ID="Panel1" runat="server" ScrollBars="none" meta:resourcekey="Panel1Resource1">
        <asp:ObjectDataSource ID="ODSUsers" runat="server" DeleteMethod="DeleteUser" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetAllUsers" TypeName="System.Web.Security.Membership">
            <DeleteParameters>
                <asp:Parameter Name="username" Type="String" />
                <asp:Parameter Name="deleteAllRelatedData" Type="Boolean" />
            </DeleteParameters>
        </asp:ObjectDataSource>
        <table style="width: 100%; text-align: center">
            <tr>
                <td style="height: 15px">
                    <asp:Label ID="lblError" runat="server" CssClass="error" Text="[ErrorMessage]" Visible="False" meta:resourcekey="lblErrorResource1"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:GridView CssClass="Grid" ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="#DEBA84"
            BorderColor="#660000" GridLines="Both" BorderStyle="Solid" CellPadding="0" CellSpacing="0"
            DataKeyNames="ProviderName,IsOnline,LastPasswordChangedDate,PasswordQuestion,IsLockedOut,Comment,UserName,Email,CreationDate,IsApproved,LastLockoutDate,LastLoginDate,ProviderUserKey,LastActivityDate"
            DataSourceID="ODSUsers" 
            Width="100%" Height="1px" meta:resourcekey="GridView1Resource1" 
            AllowPaging="true" PageSize="10"
            OnSelectedIndexChanged="GridView1_SelectedIndexChanged" 
            OnRowDataBound="GridView1_RowDataBound" 
            OnPageIndexChanging="GridView1_PageIndexChanging">
            <FooterStyle CssClass="GridFooterStyle"/>
            <Columns>
                <asp:BoundField DataField="ProviderName" HeaderText="ProviderName" ReadOnly="True" SortExpression="ProviderName" Visible="False" meta:resourcekey="BoundFieldResource1" />
                <asp:ButtonField DataTextField="UserName" HeaderText="User Name" SortExpression="UserName" CommandName="Select" meta:resourcekey="ButtonFieldResource1" />
                <asp:BoundField DataField="UserName" HeaderText="User Name" ReadOnly="True" SortExpression="UserName" meta:resourcekey="BoundFieldResource2" />
                <asp:BoundField HeaderText="Role" meta:resourcekey="sRole" />
                <asp:BoundField DataField="Email" HeaderText="Email Address" SortExpression="Email" meta:resourcekey="BoundFieldResource3" />
                <asp:CheckBoxField DataField="IsOnline" HeaderText="Currently Online" ReadOnly="True" SortExpression="IsOnline" meta:resourcekey="CheckBoxFieldResource1">
                    <ItemStyle HorizontalAlign="Center" />
                    <HeaderStyle CssClass="GridHeaderStyle" HorizontalAlign="Center" Width="60px" />
                </asp:CheckBoxField>
                <asp:CheckBoxField DataField="IsLockedOut" HeaderText="Currently Locked Out" ReadOnly="True"
                    SortExpression="IsLockedOut" meta:resourcekey="CheckBoxFieldResource2">
                    <ItemStyle HorizontalAlign="Center" />
                    <HeaderStyle CssClass="GridHeaderStyle" HorizontalAlign="Center" Width="70px" />
                </asp:CheckBoxField>
                <asp:BoundField DataField="CreationDate" HeaderText="Creation Date" ReadOnly="True"
                    SortExpression="CreationDate" meta:resourcekey="BoundFieldResource4" DataFormatString="{0:d}" />
                <asp:BoundField DataField="LastActivityDate" HeaderText="Last Activity Date" SortExpression="LastActivityDate"
                    meta:resourcekey="BoundFieldResource5" DataFormatString="{0:d}" />
                <asp:BoundField DataField="LastPasswordChangedDate" HeaderText="LastPasswordChangedDate"
                    ReadOnly="True" SortExpression="LastPasswordChangedDate" Visible="False" meta:resourcekey="BoundFieldResource6" DataFormatString="{0:d}" />
                <asp:BoundField DataField="PasswordQuestion" HeaderText="PasswordQuestion" ReadOnly="True"
                    SortExpression="PasswordQuestion" Visible="False" meta:resourcekey="BoundFieldResource7" />
                <asp:BoundField DataField="Comment" HeaderText="Comment" SortExpression="Comment"
                    Visible="False" meta:resourcekey="BoundFieldResource8" />
                <asp:CheckBoxField DataField="IsApproved" HeaderText="IsApproved" SortExpression="IsApproved"
                    Visible="False" meta:resourcekey="CheckBoxFieldResource3" />
                <asp:BoundField DataField="LastLockoutDate" HeaderText="LastLockoutDate" ReadOnly="True"
                    SortExpression="LastLockoutDate" Visible="False" meta:resourcekey="BoundFieldResource9" DataFormatString="{0:d}" />
                <asp:BoundField DataField="LastLoginDate" HeaderText="LastLoginDate" SortExpression="LastLoginDate"
                    Visible="False" meta:resourcekey="BoundFieldResource10" DataFormatString="{0:d}" />
                <asp:TemplateField HeaderText="Delete" meta:resourcekey="TemplateFieldResource1">
                    <ItemStyle HorizontalAlign="Center" Width="50px" />
                    <ItemTemplate>
                        <asp:ImageButton ID="ibDelete" runat="server" ImageUrl="~/Images/icon-delete.jpg"
                            OnClick="ibDelete_Click" meta:resourcekey="ibDeleteResource1" CausesValidation="False" />
                    </ItemTemplate>
                    <HeaderStyle CssClass="GridHeaderStyle"/>
                </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="GridRowStyle"/>
            <AlternatingRowStyle CssClass="GridAltRowStyle"/>
            <SelectedRowStyle CssClass="GridSelectedRowStyle"/>
            <PagerStyle CssClass="GridPagerStyle"/>
            <HeaderStyle CssClass="GridHeaderStyle"/>
        </asp:GridView>
    </asp:Panel>
</div>
</asp:Content>

